import React from "react";
import { Routes, Route, Outlet, Navigate } from "react-router-dom";

export default function App() {
  return (
    <div>
      <h1>App</h1>

      <Routes>
        <Route path="/" element={<Navigate to="/hello" />} />
        <Route
          path="/hello"
          element={
            <div>
              <h1>Hello</h1>
              <Outlet />
            </div>
          }
        >
          <Route
            path="home"
            element={
              <div>
                <h2>Home</h2>
                <Outlet />
              </div>
            }
          >
            <Route
              path="homes/:age"
              element={
                <div>
                  <h3>Home3</h3>
                </div>
              }
            ></Route>
          </Route>
        </Route>
      </Routes>
    </div>
  );
}
